package org.kjtc.service;

import org.kjtc.entity.*;
import org.kjtc.mapper.WeChartMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WeChartService {

    @Autowired
    private WeChartMapper weChartMapper;

    /**
     * 菜单管理
     */
    public List<WechatMenu> searchWeChatMenu(){
        return weChartMapper.getWechatMenu();
    }

    public List<WechatMenu> getWechatMenuAllLevel() {
        return weChartMapper.getWechatMenuAllLevel();
    }

    public List<WechatMenu> searchChangeMenuID(WechatMenu wechatMenu){
        return weChartMapper.getChangeMenuID(wechatMenu);
    }

    public List<WechatMenu> searchParentMenuID(WechatMenu wechatMenu){
        return weChartMapper.getParentMenuID(wechatMenu);
    }

    public void insertWeChatMenu(WechatMenu wechatMenu){
        weChartMapper.insertWechatMenu(wechatMenu);
    }

    public void saveMenuSure(WechatMenu wechatMenu){
        weChartMapper.saveMenuSure(wechatMenu);
    }

    public void updateOrderNumber(WechatMenu wechatMenu) {
        weChartMapper.updateOrderNum(wechatMenu);
    }

    public void updateWeChatMenu(WechatMenu wechatMenu){
        weChartMapper.updateWechatMenu(wechatMenu);
    }

    public void updateMoveMenu(WechatMenu wechatMenu){
        weChartMapper.updateMoveMenu(wechatMenu);
    }

    public void updateMoveMenuSure(WechatMenu wechatMenu){
        weChartMapper.updateMoveMenuSure(wechatMenu);
    }

    public void updateMenuSure(WechatMenu wechatMenu){
        weChartMapper.updateMenuSure(wechatMenu);
    }

    public void updateWechat(WechatMenu wechatMenu) {
        weChartMapper.updateWechatSure(wechatMenu);
    }

    public void deleteWeChatMenu(WechatMenu wechatMenu){
        weChartMapper.deleteWechatMenu(wechatMenu);
    }

    /*
     * 消息日志
     */
    public List<WechatMessage> searchWechatMessage(WechatMessage wechatMessage){
       return weChartMapper.getWechatMessage(wechatMessage);
    }

    public List<WechatMessage> searchWechatMessagePage(WechatMessage wechatMessage){
       return weChartMapper.getWechatMessagePage(wechatMessage);
    }

    public void saveWechatMessage(WechatMessage wechatMessage){
        weChartMapper.insertWechatMessage(wechatMessage);
    }

    public void updateWechatMessage(WechatMessage wechatMessage){
        weChartMapper.updateWechatMessage(wechatMessage);
    }

    /**
     * 用户管理
     */
    public List<WechatUser> searchWechatUser(WechatUser wechatUser){
        return weChartMapper.getWechatUser(wechatUser);
    }

    public List<WechatUser> getSendUser(WechatUser wechatUser){
        return weChartMapper.getSendUser(wechatUser);
    }

    public List<WechatUser> getWechatUserName(WechatUser wechatUser){
        return weChartMapper.getWechatUserName(wechatUser);
    }

    public void updateWechatUser(WechatUser wechatUser){
        weChartMapper.updateWechatUser(wechatUser);
    }

    public int checkWechatUserOnly(WechatUser wechatUser){
        return weChartMapper.checkWechatUserOnly(wechatUser);
    }

    public void syncWechatUser(WechatUser wechatUser){
        weChartMapper.syncWechatUser(wechatUser);
    }

    public void saveWechatUser(WechatUser wechatUser){
        weChartMapper.insertWechatUser(wechatUser);
    }

    public int deleteWechatUser(String weChatIDList){
        return weChartMapper.deleteWechatUser(weChatIDList);
    }

    /**
     * 系统设置
     */
    public List<SystemConfig> searchSystemConfig(){
        return weChartMapper.getSystemConfig();
    }

    public void updateSystemConfig(SystemConfig systemConfig){
        weChartMapper.updateSystemConfig(systemConfig);
    }

    public List<WechatConfig> getWechatConfig(WechatConfig wechatConfig){
        return weChartMapper.getWechatConfig(wechatConfig);
    }
}
